#include "LayoutReader.h"


LayoutReader::LayoutReader(IncidenceGraph& g)
	: graph(g)
{
}


LayoutReader::~LayoutReader()
{
}


bool LayoutReader::Read(String fileName)
{
	Ifstream ifs(fileName, Ifstream::in);
	while (ifs.good()) {
		int i;
		float x, y;
		ifs >> i;
		ifs >> x;
		ifs >> y;
		if (!graph.ContainsVertex(i)) return false;
		graph.SetVertex(i, Vertex(i, x, y));
	}
	return true;
}